import {createStore, compose, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
// import createSagaMiddleware from 'redux-saga';
import reducer from './reducer';
// import mySaga from '../mySaga';

// 使用saga
// const sagaMiddleware = createSagaMiddleware();

const composeEnhancers =
    typeof window === 'object' &&
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
        window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({

        }) : compose;

const enhancer = composeEnhancers(
    applyMiddleware(thunk),
);


const store = createStore(
    reducer,
    enhancer
);

// sagaMiddleware.run(mySaga);

export default store;